//func createGroupWithContacts(contacts: [String], ws: WebServiceProtocol) {
//    var memberIds = Array(contacts)
//    let userId = gosnUser.myId() ?? ""
//    if !memberIds.contains(userId) {
//        memberIds.insert(userId, at: 0)
//    }
//
//    var name: String?
//    let firstUserId = memberIds.first!
//    let userInfo = gosnUser.getUserInfo(userId: firstUserId)
//    name = userInfo?.getAlias()
//
//    for i in 1..<min(8, memberIds.count) {
//        let userInfo = gosnUser.getUserInfo(userId: memberIds[i])
//        if let userName = userInfo?.name, !userName.isEmpty {
//            if let currentName = name, currentName.count + userName.count + 1 > 16 {
//                name = KLocalizedString("de") + KLocalizedString("group")
//                break
//            }
//            name = (name ?? "") + ",\(userInfo?.getAlias() ?? "")"
//        }
//    }
//    name = name ?? KLocalizedString("GroupChat")
//
//    if let portraitImage = loadCombineView(memberIds: memberIds) {
//        if let portraitData = UIImage.jpegData(compressionQuality: 1.0, image: portraitImage) {
//            let fileSvcTool = FileSvcTool()
//            let portraitLink = fileSvcTool.uploadPortrait(portraitData: portraitData) { link in
//                // 成功回调
//            } progress: { uploaded, total in
//                // 进度回调
//            } error: { errorCode in
//                // 错误回调
//            }
//
//            MHHYAPIManager.instanceManager.createGroup(memberIds: memberIds, portrait: portraitLink, name: name!) { data in
//                MHAlert.showMessage(KLocalizedString("AlertLoading"))
//                let responseDict = data as! [String: Any]
//                let content = responseDict["groupInfo"] as! [String: Any]
//                let group = DMCCIMService.getInstance().updateGroupInfo(content: content)
//
//                DMCCIMService.getInstance().saveGroup(groupId: group.groupId, status: true) { isSuccess, json, error in
//                    if isSuccess {
//                        MHAlert.showMessage(KLocalizedString("GreatGroupSuccess"))
//                        DispatchQueue.main.async {
//                            self.dismiss(animated: true, completion: nil)
//                        }
//                    } else {
//                        MHAlert.showMessage(KLocalizedString("GreatGroupError"))
//                    }
//                }
//
//                DMCCIMService.getInstance().updateGroupFav(group: group, fav: true)
//
//                let conversation = gosnConversation.getConversationInfo(groupId: group.groupId) ?? DMCCIMService.getInstance().insertConversationWithGroup(group: group)
//
//                if let groupId = group.groupId, ws.sendGroupBlock != nil {
//                    ws.sendGroupBlock!(groupId)
//                }
//            } error: { message in
//                MHAlert.showMessage(message)
//            }
//        }
//    }
//}
//
//// 假设的国际化字符串函数
//func KLocalizedString(_ key: String) -> String {
//    return NSLocalizedString(key, comment: "")
//}
//
//// 假设的 SDWebImage 默认图片
//let SDImageDefault = UIImage(named: "defaultPlaceholderImage")
//
//// 假设的 DMCCNetworkService 和 DMCCIMService 类及方法
//class DMCCNetworkService {
//    static func getInstance() -> DMCCNetworkService {
//        return DMCCNetworkService()
//    }
//    
//    var userId: String? {
//        return "exampleUserId"
//    }
//}
//
//class DMCCIMService {
//    static func getInstance() -> DMCCIMService {
//        return DMCCIMService()
//    }
//    
//    func getUserInfo(userId: String, inGroup group: Any?, refresh: Bool) -> UserInfo {
//        // 返回用户信息
//        return UserInfo(userId: userId, name: "Example Name", portrait: "http://example.com/portrait.jpg", alias: "Example Alias")
//    }
//    
//    func updateGroupInfo(content: [String: Any]) -> GroupInfo {
//        // 更新群组信息
//        return GroupInfo(groupId: "exampleGroupId", name: "Example Group Name", portrait: "http://example.com/group_portrait.jpg")
//    }
//    
//    func saveGroup(groupId: String, status: Bool, cb: @escaping (Bool, [String: Any]?, String?) -> Void) {
//        // 保存群组
//    }
//    
//    func updateGroupFav(group: GroupInfo, fav: Bool) {
//        // 更新群组收藏状态
//    }
//    
//    func getConversation(groupId: String) -> ConversationInfo? {
//        // 获取会话
//        return ConversationInfo(groupId: groupId, unreadCount: 0)
//    }
//    
//    func insertConversationWithGroup(group: GroupInfo) -> ConversationInfo {
//        // 插入群组会话
//        return ConversationInfo(groupId: group.groupId, unreadCount: 0)
//    }
//}
//
//struct UserInfo {
//    let userId: String
//    let name: String
//    let portrait: String
//    func getAlias() -> String {
//        return name
//    }
//}
//
//struct GroupInfo {
//    let groupId: String
//    let name: String
//    let portrait: String
//}
//
//struct ConversationInfo {
//    let groupId: String
//    let unreadCount: Int
//}
//
//protocol WebServiceProtocol {
//    var sendGroupBlock: ((String) -> Void)? { get set }
//}
//
//class MHHYAPIManager {
//    static let instanceManager = MHHYAPIManager()
//    
//    func createGroup(memberIds: [String], portrait: String, name: String, completion: @escaping (Result<[String: Any], String>) -> Void) {
//        // 创建群组
//    }
//}
//
//class FileSvcTool {
//    func uploadPortrait(portraitData: Data, success: @escaping (String) -> Void, progress: @escaping (Long, Long) -> Void, error: @escaping (Int) -> Void) -> String {
//        // 上传头像
//        return "http://example.com/uploaded_portrait.jpg"
//    }
//}
